home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Other View Systems / ReadMe • Q&A next >
Encoding:
Text File  |  1996-09-17  |  7.3 KB  |  92 lines  |  [TEXT/MPS ]

  1. OpenDoc
  2. Development
  3. Framework
  4.                                                                                                                                                                                     
  5. Q & A: MacApp and PowerPlant Views Support
  6. ODF Release 1                                                                                                                                                             
  7.  
  8. What is this?
  9.  
  10. This package is a small add-on to ODF 1 to support the MacApp and PowerPlant view systems and their visual tools Ad Lib  and Constructor. 
  11.  
  12. With this add-on ODF can now understand the resource format of MacApp and PowerPlant views.  An ODF part can load  Views and PPob resources and convert them at runtime into ODF views. The part's UI can thus be built with Ad Lib  and Constructor.
  13.  
  14. What are the benefits for developers?
  15.  
  16. •  Choice of visual editors: you can now use Ad Lib or Constructor to build your part's UI (ODF also supports  AppMaker, see the folder ":Tools & Goodies:AppMaker demo:").  Ad Lib is the standard visual editor for MacApp. Constructor is part of the Metrowerks CodeWarrior tools.
  17.  
  18. • Faster UI development with a "Reload Views" command: a developer can modify the Ad Lib or Constructor resource file while the ODF part is running and then reload it to update the part dynamically.
  19.  
  20. • Extensibility: custom views built in Ad Lib or Constructor can be supported by adding a minimal amount of code.
  21.  
  22. • Path for MacApp developers who want to port existing applications to ODF and get started quickly with the UI.
  23.  
  24. • Path for PowerPlant developers who want to support OpenDoc.
  25. (Note: in the case of PowerPlant, developers will generally start with Metrowerks' PowerPart to add basic OpenDoc support to their existing PowerPlant application. When they are ready to move to ODF to get full OpenDoc support and cross-platform support, they will be able to re-use the same UI right away)
  26.  
  27. What is this release made of?
  28.  
  29. This release is an add-on to the existing ODF 1 kit, it doesn't modify ODF itself.  It consists of the following files and folders to be installed over an existing ODF 1 release:
  30.  
  31. • A MacApp Views folder containing 2 source files for converting MacApp view resources.
  32.  
  33. • A PowerPlant PPob  folder containing 2 source files for converting PowerPlant PPob resources (PPob is the resource type of PowerPlant views).
  34.  
  35. • A New ODF views folder containing 2 new useful view classes (Picture and Unknown).
  36.  
  37. • A modified ODF Form sample which demonstrates how to use this add-on in a part.  Form can be built in 3 different ways by just changing a #define, using either ODF, MacApp or PowerPlant views.
  38.  
  39. • A new ODF ViewTester part which will load any MacApp or PowerPlant resource file and test the result of converted ODF views. 
  40.  
  41. • A user guide (Read Me • User Guide) and two release notes  covering technical details not included here: MacApp Views.doc, PowerPlant Views.doc  (You can access the .doc files quickly within the projects ODFForm.π or ViewTester.π, they are listed with other source files)
  42.  
  43. How does it work?  Was ODF modified?
  44.  
  45. The add-on works with the current ODF 1 release.  No changes to the framework classes were necessary, all the code doing the loading and conversion of resources is isolated in a couple of files for MacApp and PowerPlant (*).
  46. The main idea is to parse the resource stream the same way MacApp or Powerplant code does.  For each view it builds an intermediate  "factory" object containing the view's attributes, converts the attributes that ODF supports and creates the actual ODF object.
  47.  
  48. (*) There are a couple of patches required to make the "Reload Views" command to work.  See the Installation procedures in MacApp Views.doc or PowerPlant Views.doc. 
  49.  
  50. What are the main steps to use it with my part?
  51.  
  52. If you have an existing MacApp or PowerPlant application, run the ODF ViewTester to check the conversion of your views and windows.
  53.  
  54. To use it with your part you just need to add a couple of files to your ODF part's project (see ODF Form), add the resource file containing the views, and change your code to call the right CreateSubViewsFromXXXResource method to create your frame's views. If you use custom views you will need to add code to load them too.
  55.  
  56. See the file Read Me • Installation for the complete intallation notes.
  57.  
  58. What are the limitations?
  59.  
  60. The main limitation is that the ODF view system is not as complete as MacApp or PowerPlant, so certain view classes won't be converted.  ODF 1 supports the standard controls, edit view, static text and list box classes.  Any view that is not recognized during the conversion process is replaced by a special "unknown" view which displays a red rectangle in  place of the view and shows its class id.  This way it is very easy to find out what is not being converted.  In many cases only a small amount of code is necessary to add support for unknown or custom views.  In other cases there is no possible conversion (e.g. a grid view or multi-column table class that ODF doesn't have yet) and the developer needs to either change the UI or implement the same functionality in ODF.
  61.  
  62. Also, because of the fact that it has to deal with unknown objects, the code reading  the MacApp or PowerPlant views cannot be 100% bullet-proof.  However, when it fails, there is usually enough information to find out where the  problem was and modify the original resource file.
  63.  
  64. Other limitations are:
  65. • Menus built with Constructor are not supported.
  66. • MacApp adorners and behaviors are ignored (except for the OK/Cancel buttons of a dialog window)
  67. • An ODF frame can only have 1 scroller to display its content.  MacApp or PowerPlant views containing more than 1 scroller will generate a warning and the scrollers will be ignored  (however there are ways to handle additional scrollers, for instance for a text-edit view as demonstrated in Form.)
  68.  
  69. See the .doc release notes for more details on all these issues.
  70.  
  71. How does this help me convert my MacApp or PowerPlant code to ODF?
  72.  
  73. This add-on deals only with resources.  The application code itself must be converted manually.  However being able to re-use the same views helps make this process faster.
  74.  
  75. OK, ODF can now load MacApp or PowerPlant view resources, but can it save them back into its own resource format (ODFRC)?
  76.  
  77. Not in the first version.  This feature will be added for the ODF 2 release.
  78.  
  79. It will be desirable to convert back to ODF resources for the final version of your part because this will save
  80. about 40K of code necessary to load MacApp or PowerPlant views.
  81.  
  82. How do AppMaker, Ad Lib and Constructor compare as visual editors for ODF?
  83.  
  84. Ad Lib and Constructor are pretty close in functionality.  Constructor is available to many developers because it is bundled with Metrowerks CodeWarrior.  Both Ad Lib and Constructor generate only resource files, no source code, no header files containing view ids, etc.   AppMaker's strength and flexibility comes from the fact that it is template-driven: it can be customized and it  generates both ODF view resource definitions and source code (another advantage is that the generated ODF views can be compiled for other platforms).  However AppMaker  doesn't support custom classes.
  85.  
  86. What's Next?
  87.  
  88. The next version of this add-on will be rolled into the ODF 2 release at the end of this summer.  
  89. Try it and give us your feedback on the ODF-Interest list!  
  90.  
  91.  
  92.